var mongoose = require('mongoose')

var Schema = mongoose.Schema  //可用于定义数据表结构的对象

var userSchema = new Schema({  //定义一个数据表实例
  username:String,
  password:String,
  avatar:String
})

var userModel = mongoose.model('user',userSchema) //定义一个用于操作数据表的模型对象

module.exports = userModel  //导出方法，别的js文件才能调用